package org.kosta.android.samples;

import org.kosta.android.samples.part1.ImplicitActionSamplesActivity;
import org.kosta.android.samples.part1.IntentMyActivity;
import org.kosta.android.samples.part1.IntentMyForResultActivity;
import org.kosta.android.samples.part1.LifeCycleViewActivity;
import org.kosta.android.samples.part1.SampleCodeActivity;
import org.kosta.android.samples.part1.SampleLayoutActivity;
import org.kosta.android.samples.part1.ViewGroupFrameLayoutActivity;
import org.kosta.android.samples.part1.ViewGroupLinearLayoutActivity;
import org.kosta.android.samples.part1.ViewGroupRelativeLayoutActivity;
import org.kosta.android.samples.part1.ViewGroupTableLayoutActivity;
import org.kosta.android.samples.part1.ViewSamplesActivity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class KostaAndroidSampleActivity extends Activity {
	private Button mBtn;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        /**
         * 액티비티 상단 타이틀 바를 없앨때 사용한다. 
         * 매니페스트에서도 설정이 가능함 아래와 같은 방법으로 
         * <activity android:name=".MySampleAppMainActivity" android:theme="@android:style/Theme.NoTitleBar"/>
         */
        //requestWindowFeature(Window.FEATURE_NO_TITLE);
        
        setContentView(R.layout.main);
        
        mBtn = (Button)findViewById(R.id.sample1);
        mBtn.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(v.getContext(), LifeCycleViewActivity.class);
				startActivity(intent);
			}
		});
        
        mBtn = (Button)findViewById(R.id.sample2);
        mBtn.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(v.getContext(), SampleCodeActivity.class);
				startActivity(intent);
			}
		});
        

        mBtn = (Button)findViewById(R.id.sample3);
        mBtn.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(v.getContext(), SampleLayoutActivity.class);
				startActivity(intent);
			}
		});
        
        mBtn = (Button)findViewById(R.id.sample4);
        mBtn.setOnClickListener(new View.OnClickListener() {
        	
        	@Override
        	public void onClick(View v) {
        		Intent intent = new Intent(v.getContext(), ViewSamplesActivity.class);
        		startActivity(intent);
        	}
        });
        
        mBtn = (Button)findViewById(R.id.sample5);
        mBtn.setOnClickListener(new View.OnClickListener() {
        	
        	@Override
        	public void onClick(View v) {
        		Intent intent = new Intent(v.getContext(), ViewGroupLinearLayoutActivity.class);
        		startActivity(intent);
        	}
        });
        
        mBtn = (Button)findViewById(R.id.sample6);
        mBtn.setOnClickListener(new View.OnClickListener() {
        	
        	@Override
        	public void onClick(View v) {
        		Intent intent = new Intent(v.getContext(), ViewGroupRelativeLayoutActivity.class);
        		startActivity(intent);
        	}
        });
        
        mBtn = (Button)findViewById(R.id.sample7);
        mBtn.setOnClickListener(new View.OnClickListener() {
        	
        	@Override
        	public void onClick(View v) {
        		Intent intent = new Intent(v.getContext(), ViewGroupFrameLayoutActivity.class);
        		startActivity(intent);
        	}
        });
        
        mBtn = (Button)findViewById(R.id.sample8);
        mBtn.setOnClickListener(new View.OnClickListener() {
        	
        	@Override
        	public void onClick(View v) {
        		Intent intent = new Intent(v.getContext(), ViewGroupTableLayoutActivity.class);
        		startActivity(intent);
        	}
        });
        
        mBtn = (Button)findViewById(R.id.sample9);
        mBtn.setOnClickListener(new View.OnClickListener() {
        	
        	@Override
        	public void onClick(View v) {
        		Intent intent = new Intent("kr.or.kosta.sample.action.TEST_ACTION");
				startActivity(intent);
        	}
        });
        
        mBtn = (Button)findViewById(R.id.sample10);
        mBtn.setOnClickListener(new View.OnClickListener() {
        	
        	@Override
        	public void onClick(View v) {
        		Intent intent = new Intent(v.getContext(), ImplicitActionSamplesActivity.class);
        		startActivity(intent);
        	}
        });
        
        mBtn = (Button)findViewById(R.id.sample11);
        mBtn.setOnClickListener(new View.OnClickListener() {
        	
        	@Override
        	public void onClick(View v) {
        		Intent intent = new Intent(v.getContext(), IntentMyActivity.class);
        		startActivity(intent);
        	}
        });
        
        mBtn = (Button)findViewById(R.id.sample12);
        mBtn.setOnClickListener(new View.OnClickListener() {
        	
        	@Override
        	public void onClick(View v) {
        		Intent intent = new Intent(v.getContext(), IntentMyForResultActivity.class);
        		startActivity(intent);
        	}
        });
    }
}